package com.hut.oa.model.dao.task;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.hut.oa.model.bean.AddressBook;
import com.hut.oa.model.bean.TaskFeedback;
import com.hut.oa.model.bean.TaskManage;
import com.hut.oa.model.bean.TaskUser;
import com.hut.oa.model.bean.User;
import com.hut.oa.model.bean.WorkAttend;

public interface TaskuserDao extends PagingAndSortingRepository<TaskUser, Long>{
	
	List<TaskUser> findByTask(TaskManage task);
	
	Page<TaskUser> findByUser(Pageable pageable,User user);
	
	List<TaskUser> findByUser(User user);
	
	TaskUser findByUserAndTuid(User user,Long tuid);
	
	TaskUser findByUserAndTask(User user,TaskManage task);
	
	@Query("from TaskUser tu where tu.task.tmTitle like CONCAT('%',:tittle,'%') and tu.user=:u")
	Page<TaskUser> findbytittle(Pageable pageable,@Param("tittle")String tittle,@Param("u")User u);
}

